Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: revert: build: remove dependency on Python sass module #34502

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Apr 10, 2024

Description

This PR does five things, each separated into its own commit:

  1. It re-introduces build: remove dependency on Python sass module #34439
  2. It fixes the NameError that required the revert revert: build: remove dependency on Python sass module #34476
  3. It adds ./themes/empty-theme, which can be used to trigger said NameError.
  4. It begins compiling all ./themes in CI so that the NameError wouldn't have been introduced in the first place.
  5. It fixes an unrelated site theming bug in the compile_sass management command, which I found when I began compiling themes in CI.

Testing

Same as #34439

The improved CI check will provide additional confidence in the compile_sass.py script.

Merge considerations

High-urgency, as this blocks the Python 3.11 upgrade ( #34229 )

@kdmccormick kdmccormick force-pushed the kdmccormick/libsass-python-3 branch from 5705b42 to 75ed733 Compare April 10, 2024 17:30
@kdmccormick kdmccormick force-pushed the kdmccormick/libsass-python-3 branch 3 times, most recently from 0b3db6b to 65b84e8 Compare April 11, 2024 17:54
Fixes three NameErrors which were introduced by the previous commit,
leading to it being reverted.

These NameErrors slipped through because the script was not tested on
any themes that had zero SCSS overrides.
@kdmccormick kdmccormick force-pushed the kdmccormick/libsass-python-3 branch from 65b84e8 to e2e48b2 Compare April 11, 2024 18:51
@kdmccormick kdmccormick marked this pull request as ready for review April 11, 2024 20:08
@kdmccormick kdmccormick requested a review from feanil April 12, 2024 13:54
Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes all make sense to me, glad to see this in CI now!

This will be used to protect against bugs like the on fixed in the
previous commit.
This will help safe-guard against bugs in the Sass and Webpack build
which only arise from certain uses of the legacy Comprehensive Theming
system.
This fixes the ability to pass custom theme directories to
the management command which compiles site themes, a la:

   ./manage.py lms compile_sass --theme-dirs /my/custom/themes/dir

The exception, which was due to a incompatible use of @lru_cache, was:

   File "openedx/core/djangoapps/theming/management/commands/compile_sass.py",
   line 93, in parse_arguments:
     available_themes.update({t.theme_dir_name: t for t in get_themes([theme_dir])})
   TypeError: unhashable type: 'list'

This has been broken since the @lru_cache decorator was added, but it
wasn't noticed because:

* We weren't compiling any comprehensive themes in CI.
* Tutor supports compehensive theming, but not *site theming*, so
  it doesn't use this management command at all
  (site themeing == comp theming * site configuration).
* Although edx.org executes this management command, it does not provide
  use the `--theme-dirs` argument, so the bug was not hit.
@kdmccormick kdmccormick force-pushed the kdmccormick/libsass-python-3 branch from e2e48b2 to 101aead Compare April 12, 2024 14:17
@kdmccormick kdmccormick merged commit 5fe131c into openedx:master Apr 12, 2024
66 checks passed
@kdmccormick kdmccormick deleted the kdmccormick/libsass-python-3 branch April 12, 2024 15:33
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants